package cn.tellsea.controller;


import cn.tellsea.entity.AjaxResult;
import cn.tellsea.service.IBizAccountService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * <p>
 * 账户表 前端控制器
 * </p>
 *
 * @author Tellsea
 * @since 2021-12-31
 */
@RestController
@RequestMapping("/bizAccount")
public class BizAccountController {

    @Autowired
    private IBizAccountService accountService;

    @ApiOperation("扣减账户")
    @PostMapping("/account/decrease")
    AjaxResult decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money) {
        return accountService.decrease(userId, money);
    }
}
